<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
	<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@taglib prefix="shiro" uri="http://shiro.apache.org/tags" %>
<%
	request.setCharacterEncoding("UTF-8");
	String htmlData = request.getParameter("content1") != null ? request.getParameter("content1") : "";
%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@ include file="/WEB-INF/JSP/backHome/modalWindows/StudentsListPage.jsp"%>
<%@ include file="/WEB-INF/JSP/backHome/modalWindows/argeeCommon.jsp" %>
<%@ include file="/WEB-INF/JSP/backHome/modalWindows/againstAuditCommon.jsp" %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<script type="text/javascript" src="<%=path%>/My97DatePicker/WdatePicker.js"></script>
<link rel="stylesheet" type="text/css" href="<%=path%>/CSS/backLayout.css">
<link rel="stylesheet" type="text/css" href="<%=path%>/CSS/bombBox.css">
</head>
<style>
select{width: 234px;height: 31px}
.gn_name{padding-top: 5px}

.div_zilei {
    width: 94.5%;
    height: 30px
}
.tr{height:40px;font-weight: 700}
.tr td{font-size: 14px;background: #57a0ff;color: #ffffff}
.tr_td{height: 40px;}
.tr_td td{border-bottom: 1px solid #ededed;text-align: center;}
tr td:nth-child(1) {font-size: 14px;color: #cccccc}
.date{border: 0;background: #ffffff;text-align: center;}
.tr_td td:nth-child(1){border-left: 1px solid #cccccc;}
.tr_td td:nth-child(3){border-right: 1px solid #cccccc;}
.addTable.deleteTable:HOVER{cursor:pointer;}
input[type='checkbox']{width: 15px}
#table1 input{width: 150px}
#table2 input{width: 150px;}
.loading {margin: 100px 450px;display: block;width: 65px;height: 65px;border: 1px solid #ddd;border-radius: 5px;opacity: .7;background: url(../images/loading.gif) no-repeat;}
.check2.check{width: 15px}
#table3 input{width: 150px;}
.div_input_hang {
	width: 100%;
	height: 40px;
}
.input_hang {
	float: left;
	width: 500px;
	height: 40px;
}
</style>
<body style="background: #f5f5f5">
<div class="main">
<div id="modal-overlay">
			    
</div>
		<c:if test="${empty remittanceBkf}">
			<div class="weizhi">
				财务管理>>转付补考费>>新增
			</div>
		</c:if>
		<c:if test="${not empty remittanceBkf}">
            <c:if test="${remittanceBkf.cfbillstate  <= 3 }">
			<div class="weizhi">
				财务管理>>转付补考费>>修改
			</div>
		</c:if>
		</c:if>
		<c:if test="${not empty remittanceBkf}">
            <c:if test="${remittanceBkf.cfbillstate > 3 }">
			<div class="weizhi">
				财务管理>>转付补考费>>查看
			</div>
		</c:if>
		</c:if>
	<div class="div_body" style="box-shadow: 0 0 5px #cccccc;height: 950px">
			<div class="div_form">
			<!------------------------------添加 ---------------------------->
			<c:if test="${empty remittanceBkf}">
				<form action="<%=path%>/DrivingSys/editRemittanceBkf" class="form" method="post"
					  onsubmit="return verify();">
						<div class="div_input_hang">
							<div class="input_hang">
								<span class="gn_name">驾校&nbsp;:&nbsp;</span>
								<input  type="text" name="name" class="jx" value="${department.fnameL2}" readonly="readonly" style="color: gray;"/>
							</div>
							<div class="input_hang">
								<span class="gn_name">单据编号&nbsp;:&nbsp;</span>
								<input  type="text" name="fnumber" value="${fnumber}" style="color: gray;" readonly="readonly" />
							</div>
							<div class="input_hang">
								<span class="gn_name">业务日期&nbsp;:&nbsp;</span>
								<input  type="text" name="fbizdate"  id="ywrq" value="${endTime}" 
								onclick="WdatePicker({el:'ywrq',dateFmt:'yyyy-MM-dd'})"/>
								<img onclick="WdatePicker({el:'ywrq',dateFmt:'yyyy-MM-dd'})" 
					            src="<%=path%>/image/date.jpg"  align="absmiddle" style="padding-left: 15px">
							</div>
						</div>
						<div class="div_input_hang">
							<div class="input_hang">
								<span class="gn_name">摘要&nbsp;:&nbsp;</span>
								<input name="fdescription"/>
							</div>
							<div class="input_hang">
								<span class="gn_name">单据状态&nbsp;:&nbsp;</span>
								<select name="cfbillstate" disabled="disabled">
									<option style="color: gray;">新增</option>
								</select>
							</div>
							</div> 
					<div class="div_zilei">
							<div style="width: 93%;text-align: right;">
								<img src="<%=path%>/image/insert2323.jpg" class="addTable">
								<span style="padding-right: 20px;color: #57a0ff;font-weight: 700;font-size: 14px" class="addTable">添加</span>
								<img src="<%=path%>/image/delete212.png" class="deleteTable">
								<span class="deleteTable" style="color: #57a0ff;font-weight: 700;font-size: 14px" class="deleteTable">删除</span>
							</div>
					</div>
					<input type="hidden" class="stu">
					<div style="min-height: 500px;width: 88%;padding-left: 90px;position: relative;">
					<div style="overflow:scroll;height: 500px;width: 100%"> 
							<table  width="100%" align="center" id="table1" style="min-height:50px;border-spacing:0;">
									<tr class="tr">
										<td width="40px" align="right" style="padding-left: 5px"></td>
										<td  width="40px"></td>
										<td align="center">学员</td>
										<td align="center">学员编码</td>
										<td align="center">身份证号</td>
										<td align="center">性别</td>
										<td align="center">申请车型</td>
										<td align="center">金额</td>
										<td align="center">付款</td>
										<td align="center">挂账</td>
										<td align="center">发票时间</td>
										<td align="center">发票号码</td>
										<td align="center">摘要</td>
									</tr>
							</table>
								
							<table align="center" id="table2" style="height:45px;overflow:scroll;border-spacing:0;display: none;margin-top: 100px;ma">
								<tr>
									<td width="50px" colspan="2">
										<input type="text" readonly="readonly" value="合计"
											   style="width: 40px;color: #cccccc;text-align: center;">
										</td>
										<td><input type="text" readonly="readonly" ></td>
										<td><input type="text" readonly="readonly" ></td>
										<td><input type="text" readonly="readonly" ></td>
										<td><input type="text" readonly="readonly" ></td>
										<td><input type="text" readonly="readonly" ></td>
										<td><input type="text" value="0" readonly="readonly"  id="cfamount"></td>
										<td><input type="text" value="0" readonly="readonly"  id="cffk"></td>
										<td><input type="text" value="0" readonly="readonly"  id="cfguazhang"></td>
										<td><input type="text" readonly="readonly"></td>
										<td><input type="text" readonly="readonly"></td>
										<td><input type="text" readonly="readonly"></td>
								</tr>
							</table>
						</div>
					</div>
					
					
					 <div class="div_input_hang" style="margin-top: 50px">
							<div class="input_hang">
								<span class="gn_name">审核人&nbsp;:&nbsp;</span>
								<input name="fhandlerid" readonly="readonly" style="color: gray;" type="text"/>
							</div>
							<div class="input_hang">
								<span class="gn_name">创建者&nbsp;:&nbsp;</span>
								<input name="fcreatorid2" readonly="readonly" value="${name}" style="color: gray;" type="text"/>
							</div>
							<div class="input_hang">
								<span class="gn_name">创建时间&nbsp;:&nbsp;</span>
								<input name="fcreatetime" style="color: gray;" readonly="readonly" type="text"/>
							</div> 
					</div> 
					
					<div class="div_tj" style="padding-top: 0px;margin-left: 140px;margin-top: 20px;">
						<div>
							<input class="input_submit bc" value="" type="submit" style="margin-top: 0px;margin-right: 30px;"/>
						</div>
						<div>
							<input type="button" class="input_back fh" value="" onclick="back()" style="margin-top: 0px;"/>
						</div>
					</div>
		</form>
		</c:if>
		<!------------------------------修改 ---------------------------->
		<c:if test="${not empty remittanceBkf}">
            <c:if test="${remittanceBkf.cfbillstate <= 3 }">
			<form action="<%=path%>/DrivingSys/editRemittanceBkf" class="form" method="post"
				  onsubmit="return verify();">
						<div class="div_input_hang">
							<div class="input_hang">
								<span class="gn_name">驾校&nbsp;:&nbsp;</span>
								<input  type="text" name="name" class="jx" value="${remittanceBkf.companyName}" readonly="readonly" style="color: gray;"/>
							</div>
							<div class="input_hang">
								<span class="gn_name">单据编号&nbsp;:&nbsp;</span>
								<input  type="text" name="fnumber" value="${remittanceBkf.fnumber}" style="color: gray;" readonly="readonly" />
							</div>
							<div class="input_hang">
								<span class="gn_name">业务日期&nbsp;:&nbsp;</span>
								<input  type="text" name="fbizdate"  id="ywrq" value="${remittanceBkf.fbizdate}" 
								onclick="WdatePicker({el:'ywrq',dateFmt:'yyyy-MM-dd'})"/>
								<img onclick="WdatePicker({el:'ywrq',dateFmt:'yyyy-MM-dd'})" 
					            src="<%=path%>/image/date.jpg"  align="absmiddle" style="padding-left: 15px">
							</div>
						</div>
						<div class="div_input_hang">
							<div class="input_hang">
								<span class="gn_name">摘要&nbsp;:&nbsp;</span>
								<input name="fdescription" value="${remittanceBkf.fdescription}" />
								<input type="hidden" name="fid" value="${remittanceBkf.fid}" id="fid">
							</div>
							<div class="input_hang">
								<span class="gn_name">单据状态&nbsp;:&nbsp;</span>
								<select name="cfbillstate" disabled="disabled">
									<option style="color: gray;">保存</option>
								</select>
							</div>
							</div> 
					<div class="div_zilei">
							<div style="width: 93%;text-align: right;">
								<img src="<%=path%>/image/insert2323.jpg" class="addTable">
								<span style="padding-right: 20px;color: #57a0ff;font-weight: 700;font-size: 14px" class="addTable">添加</span>
								<img src="<%=path%>/image/delete212.png" class="deleteTable">
								<span class="deleteTable" style="color: #57a0ff;font-weight: 700;font-size: 14px" class="deleteTable">删除</span>
							</div>
					</div>
					<input type="hidden" class="stu">
					<div style="min-height: 500px;width: 88%;padding-left: 90px;position: relative;">
					<div style="overflow:scroll;height: 500px;width: 100%"> 
							<table  width="100%" align="center" id="table1" style="min-height:50px;border-spacing:0;">
									<tr class="tr">
										<td width="40px" align="right" style="padding-left: 5px"></td>
										<td  width="40px"></td>
										<td align="center">学员</td>
										<td align="center">学员编码</td>
										<td align="center">身份证号</td>
										<td align="center">性别</td>
										<td align="center">申请车型</td>
										<td align="center">金额</td>
										<td align="center">付款</td>
										<td align="center">挂账</td>
										<td align="center">发票时间</td>
										<td align="center">发票号码</td>
										<td align="center">摘要</td>
									</tr>
									<c:forEach items="${remittanceBkfEntrys}" var="s">
										<tr style="margin-top: 45px" class="xy${s.fseq}">
											<td align="right" width="40px"><input type="checkbox" name="check2" style="width:15px"></td>
											<td>
												<input type="text" name="fseq2" class="fseq2" value="${s.fseq}" readonly unselectable="on" style="width:25px;border:none;color:#cccccc;text-align: center;">
												<input type="hidden" name="fseq" value="${s.fseq}" class="fseq">
											</td>
											<td><input type="text" value="${s.studentName}" readonly unselectable="on"
													   onclick="selSrtdent($(this))" class="studentName is_click_ne"
													   name="studentName"></td>
											<td class="zjzdName">
												<input type="text" value="${s.cfstudentno}" readonly unselectable="on" class="cfstudentno" name="cfstudentno">
												<input type="hidden" name="cfstudentid" value="${s.cfstudentid}">
											</td>
											<td><input type="text" readonly unselectable="on" value="${s.cfidcardno}" name="cfidcardno" class="cfidcardno"></td>
											<c:if test="${s.cfsex == '2'}">
												<td>
													<input type="text" readonly unselectable="on" name="cfsex2" class="cfsex2" value="女">
													<input type="hidden" name="cfsex" value="2">
												</td>
											</c:if>
											<c:if test="${s.cfsex == '1'}">
												<td>
													<input type="text" readonly unselectable="on" name="cfsex2" class="cfsex2" value="男">
													<input type="hidden" name="cfsex" value="1"></td>
											</c:if>
											<c:if test="${empty s.cfsex}">
												<td>
													<input type="text" readonly unselectable="on" name="cfsex2" class="cfsex2">
													<input type="hidden" name="cfsex" value="2">
												</td>
											</c:if>
											<td><input type="text" readonly unselectable="on" value="${s.cfslcx}" name="cfslcx" class="cfslcx"></td>
											<td>
												<input type="text" name="cfamount" class="cfamount" value="${s.cfamount }" onblur="bukaofei2($(this))">
												<input type="hidden" value="${s.cfamount }">
											</td>
											<td>
												<input type="text" name="cffukuang" class="cffukuang" onblur="cffukuang2($(this))" value="${s.cffukuang}">
												<input type="hidden" value="${s.cffukuang}">
											</td>
											<td>
												<input type="text" name="cfguazhang" onblur="cfguazhang2($(this))" class="cfguazhang" value="${s.cfguazhang}">
												<input type="hidden" value="${s.cfguazhang}">
											</td>
											<td>
												<input type="text" name="cffpsj" class="cffpsj" id="${s.cfstudentid}" value="${s.cffpsj2}" onclick="WdatePicker({el:'${s.cfstudentid}',dateFmt:'yyyy-MM-dd'})">
											</td>
											<td><input type="text" name="cffphm" class="cffphm" value="${s.cffphm}"></td>
											<td><input type="text" name="cfdesc" class="cfdesc" value="${s.cfdesc}"></td>
										</tr>
									</c:forEach>
							</table>

						<table align="center" id="table2"
							   style="height:40px;overflow:scroll;border-spacing:0;margin-top: 100px;ma">
								<tr>
										<td width="55px" colspan="2">
											<input type="text" readonly="readonly" value="合计"
												   style="width: 40px;color: #cccccc;text-align: center;">
										</td>
										<td><input type="text" readonly="readonly" ></td>
										<td><input type="text" readonly="readonly" ></td>
										<td><input type="text" readonly="readonly" ></td>
										<td><input type="text" readonly="readonly" ></td>
										<td><input type="text" readonly="readonly" ></td>
										<td><input type="text" value="0" readonly="readonly"  id="cfamount"></td>
										<td><input type="text" value="0" readonly="readonly"  id="cffk"></td>
										<td><input type="text" value="0" readonly="readonly"  id="cfguazhang"></td>
										<td><input type="text" readonly="readonly"></td>
										<td><input type="text" readonly="readonly"></td>
										<td><input type="text" readonly="readonly"></td>
								</tr>
							</table>
						</div>
					</div>


				<div class="div_input_hang" style="margin-top: 50px">
							<div class="input_hang">
								<span class="gn_name">审核人&nbsp;:&nbsp;</span>
								<input name="fhandlerid" readonly="readonly" style="color: gray;" type="text" value="${remittanceBkf.auditName}"/>
							</div>
							<div class="input_hang">
								<span class="gn_name">创建者&nbsp;:&nbsp;</span>
								<input name="fcreatorid2" readonly="readonly" value="${remittanceBkf.createName}" style="color: gray;" type="text"/>
							</div>
							<div class="input_hang">
								<span class="gn_name">创建时间&nbsp;:&nbsp;</span>
								<input name="fcreatetime" style="color: gray;" readonly="readonly" type="text" value="${remittanceBkf.fcreatetime}"/>
							</div>
				</div>
				<input type="hidden" id="auditState" value="${AuditState}">
					<div class="div_tj" style="padding-top: 0px">
                        <shiro:hasPermission name="/queryRemittanceCkfByFid">
                            <div>
								<input class="input_submit bc" value="" type="submit">
                            </div>
                        </shiro:hasPermission>
                        <shiro:hasPermission name="/submitRemittanceBkf">
                            <div style="padding-right: 50px">
								<input type="button" class="input_submit tj" value="" id="submit">
                                <input type="hidden" value="1">
                            </div>
                        </shiro:hasPermission>
						<div>
							<input type="button" class="input_back fh" value="" onclick="back()"/>
						</div>
					</div>
		</form>
		</c:if>
		</c:if>
		
		
		<!------------------------------查看---------------------------->
		<c:if test="${not empty remittanceBkf}">
            <c:if test="${remittanceBkf.cfbillstate > 3}">
				<form action="<%=path%>/DrivingSys/editRemittanceBkf" class="form">
						<div class="div_input_hang">
							<div class="input_hang">
								<span class="gn_name">驾校&nbsp;:&nbsp;</span>
								<input  type="text" name="name" class="jx" value="${remittanceBkf.companyName}" readonly="readonly" style="color: gray;"/>
							</div>
							<div class="input_hang">
								<span class="gn_name">单据编号&nbsp;:&nbsp;</span>
								<input type="text" name="fnumber" id="fnumber" value="${remittanceBkf.fnumber}"
									   style="color: gray;" readonly="readonly"/>
							</div>
							<div class="input_hang">
								<span class="gn_name">业务日期&nbsp;:&nbsp;</span>
								<input  type="text" name="fbizdate"  id="ywrq" value="${remittanceBkf.fbizdate}" readonly="readonly"/>
								<img src="<%=path%>/image/date.jpg" style="padding-left: 15px">
							</div>
						</div>
						<div class="div_input_hang">
							<div class="input_hang">
								<span class="gn_name">摘要&nbsp;:&nbsp;</span>
								<input name="fdescription" value="${remittanceBkf.fdescription}" readonly="readonly"/>
								<input type="hidden" name="fid" value="${remittanceBkf.fid}" id="fid">
							</div>
							<div class="input_hang">
								<span class="gn_name">单据状态&nbsp;:&nbsp;</span>
								<select name="cfbillstate" disabled="disabled">
                                    <c:if test="${remittanceBkf.cfbillstate == 4}">
                                        <option style="color: gray;">提交</option>
                                    </c:if>
                                    <c:if test="${remittanceBkf.cfbillstate == 5}">
                                        <option style="color: gray;">审核</option>
                                    </c:if>
								</select>
							</div>
							</div> 
					<div class="div_zilei">
							<div style="width: 88%;text-align: right;">
									<%--<img src="<%=path%>/image/insert2323.jpg">
                                    <span style="padding-right: 20px;color: #a9bbe0;font-size: 14px">添加</span>
                                    <img src="<%=path%>/image/delete212.png" class="deleteTable">
                                    <span style="color: #a9bbe0;font-size: 14px">删除</span>--%>
							</div>
					</div>
					<input type="hidden" class="stu">
					<input type="hidden" id="state" value="${remittanceBkf.cfbillstate}">
					<input type="hidden" id="type">
					<div style="min-height: 500px;width: 88%;padding-left: 90px;position: relative;">
					<div style="overflow:scroll;height: 500px;width: 100%"> 
							<table  width="100%" align="center" id="table3" style="min-height:50px;border-spacing:0;">
									<tr class="tr">
										<td width="40px" align="right" style="padding-left: 5px"></td>
										<td  width="40px"></td>
										<td align="center">学员</td>
										<td align="center">学员编码</td>
										<td align="center">身份证号</td>
										<td align="center">性别</td>
										<td align="center">申请车型</td>
										<td align="center">金额</td>
										<td align="center">付款</td>
										<td align="center">挂账</td>
										<td align="center">发票时间</td>
										<td align="center">发票号码</td>
										<td align="center">摘要</td>
									</tr>
									<c:forEach items="${remittanceBkfEntrys}" var="s">
										<tr style="margin-top: 45px" class="xy${s.fseq}">
											<td align="right" width="40px"><input type="checkbox" name="check2" style="width:15px" disabled="disabled"></td>
											<td>
												<input type="text" name="fseq2" class="fseq2" value="${s.fseq}" readonly="readonly" style="width:25px;border:none;color:#cccccc;text-align: center;">
												<input type="hidden" name="fseq" value="${s.fseq}" class="fseq">
											</td>
                                            <td>
                                                <input type="text" value="${s.studentName}" readonly="readonly"
                                                       class="studentName">
                                            </td>
											<td class="zjzdName">
												<input type="text" value="${s.cfstudentno}" readonly="readonly" class="cfstudentno" name="cfstudentno">
												<input type="hidden" name="cfstudentid" value="${s.cfstudentid}">
											</td>
											<td><input type="text" readonly="readonly" value="${s.cfidcardno}" name="cfidcardno" class="cfidcardno"></td>
											<c:if test="${s.cfsex == '2'}">
												<td>
													<input type="text" readonly="readonly" name="cfsex2" class="cfsex2" value="女">
													<input type="hidden" name="cfsex" value="2">
												</td>
											</c:if>
											<c:if test="${s.cfsex == '1'}">
												<td>
													<input type="text" readonly="readonly" name="cfsex2" class="cfsex2" value="男">
													<input type="hidden" name="cfsex" value="1"></td>
											</c:if>
											<c:if test="${empty s.cfsex}">
												<td>
													<input type="text" readonly="readonly" name="cfsex2" class="cfsex2">
													<input type="hidden" name="cfsex" value="2">
												</td>
											</c:if>
											<td><input type="text" readonly="readonly" value="${s.cfslcx}" name="cfslcx" class="cfslcx"></td>
											<td>
												<input type="text" name="cfamount" class="cfamount" value="${s.cfamount }" readonly="readonly">
												<input type="hidden" value="${s.cfamount }">
											</td>
											<td>
												<input type="text" name="cffukuang" class="cffukuang" readonly="readonly" value="${s.cffukuang}">
												<input type="hidden" value="${s.cffukuang}">
											</td>
											<td>
												<input type="text" name="cfguazhang" readonly="readonly" class="cfguazhang" value="${s.cfguazhang}">
												<input type="hidden" value="${s.cfguazhang}">
											</td>
											<td>
												<input type="text" name="cffpsj" class="cffpsj" id="${s.cfstudentid}" value="${s.cffpsj2}" readonly="readonly">
											</td>
											<td><input type="text" name="cffphm" class="cffphm" value="${s.cffphm}" readonly="readonly"></td>
											<td><input type="text" name="cfdesc" class="cfdesc" value="${s.cfdesc}" readonly="readonly"></td>
										</tr>
									</c:forEach>
							</table>
								
							<table align="center" id="table2" style="height:45px;overflow:scroll;border-spacing:0;margin-top: 100px;ma">
								<tr>
										<td width="55px" colspan="2">
											<input type="text" readonly="readonly" value="合计"  style="width: 45px;color: #cccccc;text-align: center;">
										</td>
										<td><input type="text" readonly="readonly" ></td>
										<td><input type="text" readonly="readonly" ></td>
										<td><input type="text" readonly="readonly" ></td>
										<td><input type="text" readonly="readonly" ></td>
										<td><input type="text" readonly="readonly" ></td>
										<td><input type="text" value="0" readonly="readonly"  id="cfamount"></td>
										<td><input type="text" value="0" readonly="readonly"  id="cffk"></td>
										<td><input type="text" value="0" readonly="readonly"  id="cfguazhang"></td>
										<td><input type="text" readonly="readonly"></td>
										<td><input type="text" readonly="readonly"></td>
										<td><input type="text" readonly="readonly"></td>
								</tr>
							</table>
						</div>
					</div>
					
					
					 <div class="div_input_hang" style="margin-top: 50px">
							<div class="input_hang">
								<span class="gn_name">审核人&nbsp;:&nbsp;</span>
								<input name="fhandlerid" readonly="readonly" style="color: gray;" type="text" value="${remittanceBkf.auditName}"/>
							</div>
							<div class="input_hang">
								<span class="gn_name">创建者&nbsp;:&nbsp;</span>
								<input name="fcreatorid2" readonly="readonly" value="${remittanceBkf.createName}" style="color: gray;" type="text"/>
							</div>
							<div class="input_hang">
								<span class="gn_name">创建时间&nbsp;:&nbsp;</span>
								<input name="fcreatetime" style="color: gray;" readonly="readonly" type="text" value="${remittanceBkf.fcreatetime}"/>
							</div> 
					</div> 
					
					<div class="div_tj">
						<c:if test="${AuditState == 'true'}">
							<shiro:hasPermission name="/auditRemittanceBkf">
								<div style="padding-right: 50px">
									<input type="button" class="input_submit sh" value="" id="sh">
									<input type="hidden" value="1">
								</div>
							</shiro:hasPermission>
						</c:if>
                        <shiro:hasPermission name="/againstAuditRemittanceBkf">
                            <div style="padding-right: 50px">
								<input type="button" class="input_submit fsh" value="" id="fsh">
							<input type="hidden" value="2">
						</div>
                        </shiro:hasPermission>
						<div>
							<input type="button" class="input_submit cklc" value=""
								   onclick="lookActivitiImg('${key}',$('#fnumber').val())"/>
						</div>
						<div>
							<input type="button" class="input_back fh" value="" onclick="back()"/>
						</div>
				</div>
		</form>
		</c:if>
		</c:if>
</div>
</div>
</div>
</body>
<script type="text/javascript" src="<%=path%>/JQuery/jquery-1.8.2.js"></script>
<%@ include file="/WEB-INF/JSP/ajax.jsp"%>
<script type="text/javascript" src="<%=path%>/HoganJS/handlebars-v4.0.11.js"></script>
<script type="text/javascript">
$(document).ready(function(){
		var type = "${type}"
		if(type == null || type == ''){
			
		}else{
			editAlert();
		}
})

//删除一行
$(".deleteTable").click(function(){
	var tr_len = $("#table1 tr").length;
	if(tr_len == 1){
		
	}else{
		var s = '';
		$('input:checkbox[name=check2]').each(function(i) {
			
			if($(this).is(':checked')){
				//减去付款
				var cffk = $(this).parent().parent().find(".cffukuang").val()
				if(cffk == '' || cffk == null){
					
				}else{
				var card = ($("#cffk").val()*1)-(cffk*1)
					//保留2位小数点
				 	card = decimal(card,2);
					$("#cffk").val(card)
				}
				//减去挂账
				var cfguazhang = $(this).parent().parent().find(".cfguazhang").val()
				if(cfguazhang == '' || cfguazhang == null){
					
				}else{
					var cash = ($("#cfguazhang").val()*1)-(cfguazhang*1)
					//保留2位小数点
				 	cash = decimal(cash,2);
					$("#cfguazhang").val(cash)
				}
				
				//减去规费
				var cfamount = $(this).parent().parent().find(".cfamount").val()
				if(cfamount == '' || cfamount == null){
					
				}else{
					var card = ($("#cfamount").val()*1)-(cfamount*1);
					//保留2位小数点
				 	card = decimal(card,2);
					$("#cfamount").val(card)
				}
				
				if(tr_len == 2){
					$("#table2").css('display','none')
				}
				$(this).parent().parent().remove();
				s = '1';
			}
		})
		if($("#table1 tr").length == 1){
			$("#table2").css('display','none')
		}
		//判断是否选中
		if(s == null || s == ''){
			alert("请选择一条数据删除");
			return false;
		}
		//重新排序
		$('#table1 tr td .fseq').each(function(i) {
			var s = i*1 + 1*1;
			$(this).val(s);
			$(this).prev().val(s)
			$(this).parent().parent().attr("class",'xy'+s);
		})
	}
})
//返回
function back(){
    parent.closeSelectCard()

    //location = '<%=path%>/DrivingSys/queryRemittanceBkf/look.action';
}

//开启弹框
$('.addTable').click(function(){
	$('#modal-overlay').css('visibility','visible')
	$('.modal-data').css('visibility','visible')
	$('.xysj input:checkbox').removeAttr('checked');
	$('#index').val(1)
	$('.page').show();
})

//键盘事件
 $(".cffukuang,.cfguazhang,.cfamount").live('keyup', function(event) {
		//最后一位是小数点的话，移除
		var $amountInput = $(this);
		//响应鼠标事件，允许左右方向键移动 
		event = window.event || event;
		if(event.keyCode == 37 | event.keyCode == 39) {
			return;
		}
		var clazz = $(this).prop("class")
     //获取父类class名称
     var superclass = $(this).parent().parent().prop("class")
		//获取输入框的值
		var value = $('.'+clazz+'').val();
		//判断负数是否在第一位
		 if(value.substring(0,1) == '-'){
			
		 }
		//判断负数不是在第一位，替换
		 if(value.lastIndexOf('-') > 0){
             $('.superclass .' + clazz + '').val("")
			// $amountInput.val($amountInput.val().replace('-','')
		 }
		//先把非数字的都替换掉，除了数字和. 
		$amountInput.val($amountInput.val().replace(/[^\-?\d.]/g, "").
		//只允许一个小数点              
		replace(/^\./g, "").replace(/\.{2,}/g, ".").
		//只能输入小数点后两位
		replace(".", "$#$").replace(/\./g, "").replace("$#$", ".").replace(/^(\-)*(\d+)\.(\d\d).*$/, '$1$2.$3'));
});

/* 关闭弹出框    */
$('.btn').click(function(){
	$('#modal-overlay').css('visibility','hidden')
	$('.modal-data').css('visibility','hidden')
	$(".stu").val("")
})
//去除重复学员数据
function studentRepetition(oneStudent, muchStudent) {
    var a = true;
    if (oneStudent == null) {
        var strs = new Array(); //定义一数组
        strs = muchStudent.split(",");//转换成数组
        //循环添加的学员
        for (var i = 0; i < strs.length; i++) {
            //循环现有的学员
            $("input[name='cfstudentid']").each(function (j) {
                //判断添加的学员不能与现有的学员重复
                if (strs[i] == $(this).val()) {
                    a = false
                }
            })
        }
    } else {
        //循环现有的学员
        $("input[name='cfstudentid']").each(function (j) {
            //判断添加的学员不能与现有的学员重复
            if (oneStudent == $(this).val()) {
                a = false
            }
        })
    }
    return a;
}

//选择数据
 $('.subtn').click(function () {
	 //规费
 	 var gf = 0;
	 var fseq = $(".stu").val();
	 var tr_len = $("#table1 tr").length;//表格长度
	 var spCodesTemp = "";
	 if(fseq == '' || fseq == null){
		 $('input:checkbox[name=student]:checked').each(function (i) {
	         if (0 == i) {
	             //把学生id增加到字表中
	             spCodesTemp = $(this).val();
	         } else {
	             spCodesTemp += ("," + $(this).val());
	
	         }
	     });
		 if(spCodesTemp == ""){
			 alert("请至少选择一条数据")
			 return false
		 }
         var a = studentRepetition(null, spCodesTemp)
         if (!a) {
             alert("不能添加重复学员");
             return;
         }
	     $.ajax({
	          url: '<%=path%>/DrivingSys/selStudentByFid',
	          type: "post",
	          async: true,
	          data: {'id': spCodesTemp},
	          dataType: "json",
	          success: function (json) {
	        	  onDblclick(json,fseq)
	            },
	            error: function () {
	                alert('Error');
	            }
	       })
	 }else{
		$('input:checkbox[name=student]:checked').each(function(i) {
		     if (0 == i) {
		          //把学生id增加到字表中
		          spCodesTemp = $(this).val();
		     } 
		})
		if(spCodesTemp == null){
	        alert("请选择一条数据")
	        return false
	    }
         var a = studentRepetition(spCodesTemp, null)
         if (!a) {
             alert("不能添加重复学员");
             return;
         }
	      $.ajax({
		       url: '<%=path%>/DrivingSys/selStudentByFid',
		       type: "post",
		       async: true,
		       data: {'id': spCodesTemp},
		       dataType: "json",
		       success:function(json){
		          onDblclick(json,fseq)
		       }
     	});
	 }
 });
 
 function jsbkf(){
	 var cfamount = 0;
		$(".cfamount").each(function(i){
			var s = $(this).val();
			if(s == null || s == ''){
				s = 0;
			}
			cfamount = (cfamount*1) + (s*1);
			cfamount = decimal(cfamount,2);
		})
		$("#cfamount").val(cfamount)
 }
 
//计算补考费
function bukaofei2 (_this) {
		//避免最后一个字符串是.
	 	_this.val((_this.val().replace(/\.$/g, "")));
	 	if(_this.val() == '-'){
			_this.val("")
		}
    //判断输入错误
    if (isNaN(Number(_this.val()))) {
        _this.val("")
    }
		 //现金
		 var money = _this.val()
		 if(money == ''){
			 money = 0;
		 }
		//存放之前的值
		var zq =  _this.next().val();
		_this.next().val(money);
		//计算总额
		jsbkf();
}
 
 //付款计算
 function cffukuang2 (_this) {
		//避免最后一个字符串是.
	 	_this.val((_this.val().replace(/\.$/g, "")));
	 	if(_this.val() == '-'){
			_this.val("")
		}
     //判断输入错误
     if (isNaN(Number(_this.val()))) {
         _this.val("")
     }
		 //现金
		 var money = _this.val()
		 if(money == ''){
			 money = 0;
		 }
		//存放之前的值
		var zq =  _this.next().val();
		_this.next().val(money);
		//总额
		var ze = $("#cffk").val();
		//计算总额
		var jine = (ze*1) - (zq*1) +(money*1);
		//保留2位小数点
		jine = decimal(jine,2);
		$("#cffk").val(jine);
 }

//挂账计算
 function cfguazhang2 (_this) {
		//避免最后一个字符串是.
	 	_this.val((_this.val().replace(/\.$/g, "")));
	 	if(_this.val() == '-'){
			_this.val("")
		}
     //判断输入错误
     if (isNaN(Number(_this.val()))) {
         _this.val("")
     }
		 //现金
		 var money = _this.val()
		 if(money == ''){
			 money = 0;
		 }
		//存放之前的值
		var zq =  _this.next().val();
	    _this.next().val(money);
		 
		//总额
		var ze = $("#cfguazhang").val();
		//计算总额
		var jine = (ze*1) - (zq*1)+(money*1);
		//保留2位小数点
		jine = decimal(jine,2);
		$("#cfguazhang").val(jine);
 } 
 
 //点击单个学员
 function selSrtdent(_this){
	 //获取当前对象序列
	 var ss = _this.parent().prev().find(".fseq").val();
	 $(".stu").val(ss);
	 $('#modal-overlay').css('visibility','visible')
	 $('.modal-data').css('visibility','visible')
	 $('.xysj input:checkbox').removeAttr('checked');
 }
 
//num是要处理的数字  v为要保留的小数位数
function decimal(num,v){
	var vv = Math.pow(10,v);
	return Math.round(num*vv)/vv;
}

//双击确定
$(document).on('dblclick','.xysj td',function(){
	 var fseq = $(".stu").val();
	 var spCodesTemp = $(this).parent().find("input:checkbox").val();
    var a = studentRepetition(spCodesTemp, null)
    if (!a) {
        alert("不能添加重复学员");
        return;
    }
	   $.ajax({
          url: '<%=path%>/DrivingSys/selStudentByFid',
          type: "post",
          async: true,
          data: {'id': spCodesTemp},
          dataType: "json",
          success: function (json) {
        	  onDblclick(json,fseq)   	
          },
          error: function () {
              alert('Error');
          }
	}) 
})

//把数据放进去
function onDblclick(json,fseq){
      var jine = 0;
      if(fseq == null || fseq == ''){
    	  //表格长度
    	  var tr_len = $("#table1 tr").length;
    	  var str;
    	  var cfamount = 0;
	  	  var studentsNameList = json.studentsNameList;
    	  for(var i=0;i<studentsNameList.length;i++) {
	        	 str+='<tr style="margin-top: 45px" class=xy'+(tr_len+i)+'>'
	        	 str+='<td align="right" width="40px"><input type="checkbox" name="check2" style="width:15px"></td>'
		         str+='<td><input type="text" name="fseq2" class="fseq2" value='+(tr_len+i)+' readonly unselectable="on" style="width:25px;border:none;color:#cccccc;text-align: center;"><input type="hidden" name="fseq" value='+(tr_len+i)+' name="fseq" class="fseq"></td>'
	            if(studentsNameList[i].fnameL2 == null){
                    str += '<td><input type="text" onclick="selSrtdent($(this))" class="studentName is_click_ne" readonly unselectable="on" name="studentName"/></td>'
	            }else{
                    str += '<td><input type="text" value=' + studentsNameList[i].fnameL2 + ' readonly unselectable="on"  onclick="selSrtdent($(this))" class="studentName is_click_ne"  name="studentName"/></td>'
	            }
		         
	            if(studentsNameList[i].fnumber == null){
	            	str+='<td class="zjzdName"><input type="text" readonly unselectable="on" name="cfstudentno" class="cfstudentno"/><input type="hidden" name="cfstudentid" value='+studentsNameList[i].fid+'></td>'	
	            }else{
	     	    	str+='<td class="zjzdName"><input type="text" value='+studentsNameList[i].fnumber+' readonly unselectable="on" class="cfstudentno" name="cfstudentno" /><input type="hidden" name="cfstudentid" value='+studentsNameList[i].fid+'></td>'
	            }
	            if(studentsNameList[i].cfidcardno == null){
	            	str+='<td><input type="text" readonly unselectable="on" name="cfidcardno" class="cfidcardno"/></td>'	
	            }else{
	     	    	str+='<td><input type="text" readonly unselectable="on" value='+studentsNameList[i].cfidcardno+' name="cfidcardno" class="cfidcardno"/></td>'
	            }
	            if(studentsNameList[i].cfsex == '1'){
	            	str+='<td><input type="text" readonly unselectable="on" name="cfsex2" class="cfsex2" value="男"/><input type="hidden" name="cfsex" value="1"></td>'	
	            }else{
	            	str+='<td><input type="text" readonly unselectable="on" name="cfsex2" class="cfsex2" value="女"/><input type="hidden" name="cfsex" value="2"></td>'	
	            }
	            if(studentsNameList[i].cfslzjcxdh == null){
	            	str+='<td><input type="text" readonly unselectable="on" name="cfslcx" class="cfslcx"/></td>'	
	            }else{
	     	    	str+='<td><input type="text" readonly unselectable="on" value='+studentsNameList[i].cfslzjcxdh+' name="cfslcx" class="cfslcx"/></td>'
	            }
	          	//补考缴费
	            var bukao = bkf(studentsNameList[i].cfstudentstate);
	            cfamount = cfamount*1 + bukao*1;
	            cfamount = decimal(cfamount,2);
	            str+='<td><input type="text" name="cfamount" class="cfamount" value='+bukao+' onblur="bukaofei2($(this))"><input type="hidden"></td>'
	            var fpsj = studentsNameList[i].fid;
	            str+='<td><input type="text" name="cffukuang" class="cffukuang" onblur="cffukuang2($(this))"/><input type="hidden" value="0"></td>'
	            str+='<td><input type="text" name="cfguazhang" onblur="cfguazhang2($(this))" class="cfguazhang"/><input type="hidden" value="0"></td>'
	            str+='<td><input type="text" name="cffpsj" class="cffpsj" id='+fpsj+' onclick=\"WdatePicker({el:\''+fpsj+'\',dateFmt:\'yyyy-MM-dd\'})\"></td>'
	            str+='<td><input type="text" name="cffphm" class="cffphm"/></td>'                      
	            str+='<td><input type="text" name="cfdesc" class="cfdesc"/></td>'
	     }
    	   //计算金额
    	   var shje =  $("#cfamount").val();
			   shje = shje*1 + cfamount*1
			   shje = decimal(shje,2);
    	   $("#cfamount").val(shje)
		   $("#table2").show()
		   $("#table1").append(str)
           $('#modal-overlay').css('visibility', 'hidden')
           $('.modal-data').css('visibility', 'hidden')
      }else{
    	  var studentsNameList1 = json.studentsNameList[0];
    	  //获取之前规费
    	  var gf2 = $('.xy'+fseq+'').find(".cfamount").val();
    	  if(studentsNameList1.fnameL2 == null){
    		  
    	  }else{
    	  	var sgeifei = $('.xy'+fseq+'').find(".studentName").val(studentsNameList1.fnameL2);
    	  }
    	  if(studentsNameList1.fnumber == null){
    		$('.xy'+fseq+'').find(".cfstudentno").next().val(studentsNameList1.fid);
    	  }else{
    	  	$('.xy'+fseq+'').find(".cfstudentno").val(studentsNameList1.fnumber);
    	  	$('.xy'+fseq+'').find(".cfstudentno").next().val(studentsNameList1.fid);
    	  }
    	  if(studentsNameList1.cfsex == '1'){
    		 $('.xy'+fseq+'').find(".cfsex").next().val(1);
    		 $('.xy'+fseq+'').find(".cfsex").next().val("男");
    	  }else{
    		 $('.xy'+fseq+'').find(".cfsex").val("女");
    		 $('.xy'+fseq+'').find(".cfsex").next().val(2);
    	  }
    	  if(studentsNameList1.cfidcardno == null){
    		  
    	  }else{
    	  	$('.xy'+fseq+'').find(".cfidcardno").val(studentsNameList1.cfidcardno);
    	  }
    	  if(studentsNameList1.cfslzjcxdh == null){
    		  
    	  }else{
    	  	 $('.xy'+fseq+'').find(".cfsqcx").val(studentsNameList1.cfslzjcxdh);
    	  }
    	  //补考缴费
          var bukao = bkf(studentsNameList1.cfstudentstate);
          //计算应收金额
          var zongbk = $("#cfamount").val();
          var bk = $('.xy'+fseq+'').find(".cfamount").val()
          zongbk = zongbk*1 - bk*1 + bukao*1;
          zongbk = decimal(zongbk,2);
          $('.xy'+fseq+'').find(".cfamount").val(bukao);
          $("#cfamount").val(zongbk)
	      $('#modal-overlay').css('visibility', 'hidden')
	      $('.modal-data').css('visibility', 'hidden')
		  $(".stu").val("");
	}
}

//设置全选功选 
$('.check').click(function(){
	if($(this).attr("checked")){
		 $(":checkbox").prop("checked",true) 
	}else{
		$('input:checkbox').removeAttr('checked')
	}
})

   //由于和input:checkbox冲突，在选择一次
 $("#table1 tr td input:checkbox").live('click',function(){
	 if($(this).is(':checked')){
	    	$(this).removeAttr("checked");
	    }else{
	    	$(this).attr("checked",":checked")
	    }
 })
  //单击选中
  $("#table1 tr td").live('click',function(){
    if($(this).parent().find("input:checkbox").is(':checked')){
    	$(this).parent().find("input:checkbox").removeAttr("checked");
    }else{
    	$(this).parent().find("input:checkbox").attr("checked",":checked")
    }
 })  
 
 //根据学员状态获取补考费
 function bkf(cfstudentstate){
	 var bukao = 0;
	 $.ajax({
    	 url: '<%=path%>/DrivingSys/selMakeupChatge',
         type: "post",
         async: false,
         data: {'state': cfstudentstate},
         dataType: "json",
         success:function(json){
        	 bukao = json;
         },
         error: function () {
             alert('Error');
         }
    }) 
    return bukao;
 }
 
 //当前加载计算总和
window.onload=function() {
	//计算规费金额
	var cfamount = 0;
	$(".cfamount").each(function(i){
		var s = $(this).val();
		if(s == null || s == ''){
			s = 0;
		}
		cfamount = (cfamount*1) + (s*1);
		cfamount = decimal(cfamount,2);
	})
	$("#cfamount").val(cfamount)
	
	//计算付款
	var cffk = 0;
	$(".cffukuang").each(function(i){
		var s = $(this).val();
		if(s == null || s == ''){
			s = 0;
		}
		cffk = (cffk*1) + (s*1);
		cffk = decimal(cffk,2);
	})
	$("#cffk").val(cffk)
	
	//计算挂账金额
	var cfguazhang = 0;
	$(".cfguazhang").each(function(i){
		var s = $(this).val();
		if(s == null || s == ''){
			s = 0;
		}
		cfguazhang = (cfguazhang*1) + (s*1);
		cfguazhang = decimal(cfguazhang,2);
	})
	$("#cfguazhang").val(cfguazhang)
	
}
//审核,反审核弹框
$("#sh,#fsh").click(function () {
    var type = $(this).next().val();
    $("#type").val(type)
    if (type == 1) {
        $('#modal-overlay').css('visibility', 'visible')
        $('.modal-data9').css('visibility', 'visible')
        $('li input:radio:first').attr('checked', 'checked');
    }
    else if (type == 2) {
        $('#modal-overlay').css('visibility', 'visible')
        $('.modal-data10').css('visibility', 'visible')
    }
})

//审核,反审核
$("#auditsubmit,#againstAuditsubmit").click(function () {
    //防止重复提交
    $(this).attr("disabled", "disabled")
    var state = $('li input[type="radio"]:checked ').val();//同意/不同意
    var fid = $("#fid").val();//fid
    var fnumber = $("input[name='fnumber']").val();//编码
    var type = $("#type").val();
    var message;
    if (type == '1') {
        message = $("#auditcomment").val();
    } else {
        message = $("#againstAuditcomment").val();
    }
    var studentName = new Array();
    var studentId = new Array();
    var cfstudentno = new Array();
    $(".studentName").each(function (i) {
        studentName[i] = $(this).val();
        studentId[i] = $(this).parent().next().find("input:hidden").val();
        cfstudentno[i] = $(this).parent().next().find(".cfstudentno").val();
    })
    $.ajax({
        url: '<%=path%>/DrivingSys/auditRemittanceBkf',
        type: "post",
        data: {
            'fid': fid,
            'type': type,
            'fnumber': fnumber,
            'message': message,
            'state': state,
            'studentName': studentName,
            'studentId': studentId,
            'cfstudentno': cfstudentno
        },
        dataType: "json",
        success: function (json) {
            var url = '/queryRemittanceBkf/look.action';
            if (type == '1') {
                if (json == '1') {
                    showAlert('审核成功,并且此流程已结束', url)
                } else if (json == '2') {
                    showAlert('审核成功', url)
                } else {
                    showAlert('审核失败', url)
                }
            } else {
                if (json == '1') {
                    showAlert('反审核成功', url)
                } else if (json == '2') {
                    showAlert('没有找到任务', url)
                } else if (json == '0') {
                    showAlert('找不到流程节点', url)
                }
            }
        },
        error: function () {
            $("#againstAuditsubmit,#auditsubmit").attr("disabled", false)//去除input元素的disabled属性
            alert('错误');
        }
    })
})

//提交
$("#submit").click(function () {
    $.messager.confirm('提示', '是否提交,提交后不会改变修改后的值', function (r) {
        if (r) {
            var url = '/queryRemittanceBkf/look.action';
            var fid = $("#fid").val();
            var fnumber = $("input[name='fnumber']").val();
            var auditState = $("#auditState").val();
            var studentName = new Array();
            var studentId = new Array();
            var cfstudentno = new Array();
            $(".studentName").each(function (i) {
                studentName[i] = $(this).val();
                studentId[i] = $(this).parent().next().find("input:hidden").val();
                cfstudentno[i] = $(this).parent().next().find(".cfstudentno").val();
            })
            $.ajax({
                url: '<%=path%>/DrivingSys/submitRemittanceBkf',
                type: "post",
                data: {
                    'fid': fid,
                    'fnumber': fnumber,
                    'auditState': auditState,
                    'studentName': studentName,
                    'studentId': studentId,
                    'cfstudentno': cfstudentno
                },
                dataType: "json",
                success: function (json) {
                    if (json == 1) {
                        showAlert('提交成功', url)
                    } else {
                        showAlert('提交失败', url)
                    }
                },
                error: function () {
                    alert('Error');
                }
            })
        }
    })
})
//验证单据下是否有数据
function verify() {
    var s = 0;
    var a = 0;
    $("input[name='cfstudentid']").each(function () {
        if ($(this).val() == '' || $(this).val() == null) {
            a = 1;
        } else {
            s = 1;
        }

    })

    var ywrq = $("#ywrq").val();
    if (ywrq == null || ywrq == '') {
        alert("业务日期不能为空");
        return false;
    }

    if (a == 1) {
        alert("学员不能为空")
        return false;
    }
    if (s == 0) {
        alert("请至少添加一条数据");
        return false;
    }
    $("input[type='submit']").attr("disabled", "disabled");
}

//只读的属性不被修改
$('input[readonly]').on('focus', function () {
    $(this).trigger('blur');
});
</script>
</html>